import { ref } from 'vue'
 
export default {
    scrollUp(tableRef) {
         const demo = tableRef.$refs.bodyWrapper.getElementsByClassName('el-scrollbar__wrap')[0]
         const tableScroll = ref(true)
         demo.addEventListener('mouseover', () => {
             tableScroll.value = false
         })
         demo.addEventListener('mouseout', () => {
             tableScroll.value = true
         })
         setInterval(() => {
             if(tableScroll.value) {
                 demo.scrollTop += 1
                 if(demo.clientHeight + demo.scrollTop === demo.scrollHeight) {
                     demo.scrollTop = 0
                 }
             }
         }, 100)
    }
}